package com.d3works.apps.project.web;

import com.d3works.apps.project.db.Project;
import com.d3works.apps.project.service.ProjectDashboardService;
import com.d3works.auth.AuthUtils;
import com.d3works.inject.Beans;
import com.d3works.rpc.ActionRequest;
import com.d3works.rpc.ActionResponse;
import com.google.inject.Singleton;

@Singleton
public class ProjectDashboardController {

  public void getData(ActionRequest request, ActionResponse response) {
    Project project = AuthUtils.getUser().getContextProject();
    if (project == null) {
      return;
    }
    response.setValues(Beans.get(ProjectDashboardService.class).getData(project));
  }
}
